﻿using UnityEditor.Experimental.GraphView;
using UnityEngine;

public class BuffCharge : BuffBase
{
    int gainAtk = 0;
    public BuffCharge() : base()
    {
        Type = BuffType.Charge;
        Name = "冲锋";
    }

    public override void OnEndDamage(UnitBase attacker, UnitBase defender)
    {
        if (Owner == attacker)
        {
            attacker.atk_fix -= gainAtk;
            gainAtk = 0;
        }
    }
    public override void OnEndPhase()
    {
        Owner.atk_fix -= gainAtk;
        gainAtk = 0;
    }
    public override void OnEndAction(ActionType action, Vector2Int target)
    {
        if (action == ActionType.Move)
        {
            gainAtk += 1;
            Owner.atk_fix += 1;
        }
    }
    public override string ToString()
    {
        return "冲锋：随着移动的距离提升攻击力；攻击后复原";
    }
}